<template>
    <section class="mainSection">
        <goback :getName='goName' :getURL="goType" :getBtn='goBtn'></goback>
        <article>
            <div class="datailData-content">
                <div v-html="datailData.context"></div>
            </div>
        </article>
        
    </section>
</template>
<script>
    import { getContextById } from '../../libs/interface' // 获取接口
    import goback from '../../components/goback'
    export default {
        components: { goback, getContextById },
        data () {
            return {
                datailData: {},
                goName: '',
                goType: '', // 导航返回页面，如返回上一级则为空
                goBtn: '', // 导航右边菜单，如没有则不填
            }
        },
        mounted () {
            document.body.style.paddingBottom = 0
            let vm = this
            let params = {
                id: vm.$route.params.id,
            }
            getContextById(params, (data) => {
                console.log(data)
                if (data.code === 1) {
                    console.log('获取数据成功!')
                    vm.datailData = data.payload
                } else {
                    vm.$toast('暂未请求到数据,请稍后再试')
                }
            })
        }
    }
</script>
<style scoped>
.mainSection{
    background-color: #fff;
    text-align: left;
}
article{
    width: 92%;
    margin: 0 auto;
}
img{
    width: 100%;
}
</style>